<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\JsTanController;
use App\Http\Controllers\Api\KuajingyunController;
use App\Http\Controllers\Api\XinShiDaController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});


Route::group(['namespace'=>'Api'], function ($api) {

    // 测试
    Route::post('/jstan/test', [JsTanController::class, 'test']);
    Route::post('/kuajingyun/test', [KuajingyunController::class, 'test']);
    Route::post('/xinshida/test', [XinShiDaController::class, 'test']);
    Route::post('/xinshida/receive_order', [XinShiDaController::class, 'receive_order']);
    Route::post('/xinshida/order_delivery', [XinShiDaController::class, 'order_delivery']);

    // 店铺资料上传
    Route::post('/jstan/upload_skumap', [JsTanController::class, 'upload_skumap']);

    // 普通商品资料上传
    Route::post('/jstan/upload_itemsku', [JsTanController::class, 'upload_itemsku']);

    // 订单上传
    Route::post('/jstan/upload_orders', [JsTanController::class, 'upload_orders']);

    // 接收: 订单发货
    Route::any('/jstan/order_delivery', [JsTanController::class, 'order_delivery']);

    // 接收: 订单取消
    Route::any('/jstan/order_cancel', [JsTanController::class, 'order_cancel']);

    // 接收: 更新库存
    Route::any('/jstan/update_inventory', [JsTanController::class, 'update_inventory']);

    // 接收: 订单确认
    Route::any('/jstan/confirm_delivery', [JsTanController::class, 'confirm_delivery']);


});